package com.zone.infrastructure.persistent.dao;

import com.zone.infrastructure.persistent.po.RaffleActivityOrder;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.time.LocalDateTime;
import java.util.List;

/**
 * @author: zongzi
 * @description: TODO
 * @date: 2024/6/24
 */
@Mapper
public interface IRaffleActivityOrderDao {

    /**
     * 新增
     *
     * @param order 订单实体
     */
    void insert(RaffleActivityOrder order);

    /**
     * 查询抽奖活动订单
     *
     * @param userId 用户id
     * @return 抽奖活动订单
     */
    List<RaffleActivityOrder> list(@Param("userId") String userId);

    RaffleActivityOrder queryActivityOrderByOutBusinessNo(@Param("outBusinessNo") String outBusinessNo);

    void updateComplelte(RaffleActivityOrder activityOrder);

    RaffleActivityOrder queryRecentOneMonthNoPayOrder(@Param("userId") String userId, @Param("sku") Long sku, @Param("code") String code, @Param("startTime") LocalDateTime startTime);
}
